import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.wzdigit.WzdigitWmsWmsApplication;
import com.wzdigit.wms.basic.client.request.report.PeakReportRequest;
import com.wzdigit.wms.basic.domain.inventory.Lotno;
import com.wzdigit.wms.basic.domain.mid.IfPostback;
import com.wzdigit.wms.basic.domain.transfer.PicktaskDtlGoods;
import com.wzdigit.wms.basic.enums.writeback.TopicEnum;
import com.wzdigit.wms.basic.mapper.core.inventory.LotnoMapper;
import com.wzdigit.wms.basic.mapper.core.mid.IfPostbackMapper;
import com.wzdigit.wms.basic.mapper.core.transfer.PicktaskDtlGoodsMapper;
import com.wzdigit.wms.wms.domain.inv.count.InvCountDtl;
import com.wzdigit.wms.wms.mapper.inv.count.InvCountDtlMapper;
import com.wzdigit.wms.wms.service.core.OqcNewTaskService;
import com.wzdigit.wms.wms.service.inv.count.StockCountDtlService;
import com.wzdigit.wms.wms.service.mid.IfPostbackService;
import com.wzdigit.wms.wms.service.report.MaterialPeakService;
import com.wzdigit.wms.wms.service.report.WarehousePeakService;
import com.wzdigit.wms.wms.service.transfer.GdnCtnrService;
import com.wzdigit.wms.wms.service.wms2sap.PurchaseOrderService;
import com.wzdigit.wms.wms.strategy.webservice.handle.SendWebServiceHandle;
import com.wzdigit.wms.wms.task.IfCompDeliveryTask;
import com.wzdigit.wms.wms.task.IfRepackdeliveryToGdnTask;
import com.wzdigit.wms.wms.task.IfTransferHeaderTask;
import org.apache.http.HttpStatus;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.util.DigestUtils;

import java.io.UnsupportedEncodingException;
import java.lang.reflect.Field;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = WzdigitWmsWmsApplication.class)
public class Datetest {



    @Autowired
    GdnCtnrService gdnCtnrService ;

    @Autowired
    PicktaskDtlGoodsMapper picktaskDtlGoodsMapper;
    @Test
    public void test(){
        QueryWrapper<PicktaskDtlGoods> wrapper = new QueryWrapper();
        Map<Integer,Integer> map = new HashMap<>();

        map.put(23612,2180199);
        map.put(23613,2180199);
        map.put(23601,2180192);
        List<Integer> ids = Arrays.asList(23612, 23613, 23601);
        wrapper.in("PICKTASK_DTL_ID",ids);
        List<PicktaskDtlGoods> picktaskDtlGoods = picktaskDtlGoodsMapper.selectList(wrapper);
        int i = 0 ;
        for(PicktaskDtlGoods item : picktaskDtlGoods){

            gdnCtnrService.checkSn(item.getGoodsSn(),map.get(item.getPicktaskDtlId()).longValue(),false);
            System.out.println("i====>"+i++);
        }


    }

}
